﻿using System.Linq;
using System.Collections.Generic;

namespace SilverlightHVP.View
{
   public class TimeManager
   {
      public static void WatchedTimePassed(
         List<long> watchedTime,
         long timeToCompare,
         out List<long> valuesFound )
      {

         var orderedLongs = from entry in watchedTime
                            orderby entry
                            select entry;
         valuesFound = new List<long>();

         foreach ( long watchedForValue in orderedLongs )
         {
            if ( watchedForValue <= timeToCompare )
            {
               watchedTime.Remove( watchedForValue );
               valuesFound.Add( watchedForValue );
            }
         }
      }
   }

}
